package com.cloud.sample.util;

import com.cloud.common.util.UUIDUtils;

import java.io.File;
import java.util.UUID;

public class FileHelper {

    public static String getTempFilePath() {
        String uuid = UUID.randomUUID().toString().replaceAll("-", "");
        return System.getProperty("java.io.tmpdir") + File.separator + uuid;
    }

    public static String getRandomFileName(String originalFilename) {
        return UUIDUtils.get() + originalFilename.substring(originalFilename.lastIndexOf("."));
    }
}
